11 int dp(int p
, int s
, int i
){
16 if (p
+ w
[i
] <= capacity
) ans
= max(ans
, dp(p
+ w
[i
], s
, i
+1) + 1);
17 if (s
+ w
[i
] <= capacity
) ans
= max(ans
, dp(p
, s
+ w
[i
], i
+1) + 1);
19 //cout << p << " " << s << " " << i << " ";
20 //cout << ans << endl;
40 cout
<< dp(0,0,0) << endl
;